﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TSqlServer;
public partial class log_LogAboutMe : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Bind();
        }
        
    }
    public void Bind()
    {

        //isnull(c.mypic,'user.jpg')
        string userid = " (select iid from t_user1 where userid='"+Session["userid"].ToString() +"' )";
        string sSql = "select b.id,b.title,b.content,a.friend_id,b.intime,'..\\user\\pics\\' + (case when len(c.mypic)=0 then 'user.jpg' else c.mypic end ) as img, c.bigname from t_log_relationship as a " +
                      " inner join t_log_info as b on b.id=a.log_id "+
                      " left join t_user as c on c.email=b.inman " +
                      " where b.status='1' and (((select authority from t_log_type where id=b.typeid)=1  and b.authority=0) or b.authority=1) and a.friend_id=" + userid;
        TSqlDBReader myReader = new TSqlDBReader(sSql);
        dlTable.DataSource = myReader.FDataReader;
        dlTable.DataBind();
        myReader.Free();
                      
    }
}
